package com.liuhuxiang.order;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;

/**
 * 启动类
 * 使用restTemplate方式调用
 *
 * @author liuhuxiang
 * @version: OrderSeataApplication.java, 2023年03月09日 下午3:34 liuhuxiang  Exp $
 */
@SpringBootApplication
@EnableTransactionManagement     // 开启本地事务@Transactional
public class OrderSeataApplication {

    public static void main(String[] args) {
        SpringApplication.run(OrderSeataApplication.class,args);
    }

    @Bean
    public RestTemplate restTemplate(RestTemplateBuilder builder){
        RestTemplate restTemplate = builder.build();
        return restTemplate;
    }
}
